/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package BO;

import BO.Iter.TraLoiBO;
import DAO.Iter.TraLoiDAO;
import TableModel.Dapan;
import java.util.List;


/**
 *
 * @author vt
 */
public class TraLoiBOImpl implements TraLoiBO {
 private TraLoiDAO tlDao;

    public TraLoiDAO getTlDao() {
        return tlDao;
    }

    public void setTlDao(TraLoiDAO tlDao) {
        this.tlDao = tlDao;
    }
    @Override
    public List<Dapan> findAllTraloi() {
        return tlDao.findAllTraloi();
    }

    @Override
    public Dapan findTraLoi(String idCauhoi) {
      return tlDao.findTraLoi(idCauhoi);
    }

    @Override
    public Dapan findTraLoi(String userName, String paawrod) {
      return  tlDao.findTraLoi(userName, paawrod);
    }

    @Override
    public void update(Dapan id) {
        tlDao.update(id);
    }

    @Override
    public long add(Dapan id) {
        return tlDao.add(id);
    }
    @Override
    public List<Dapan> getListTraLoiWithoutKetQua(String id) {
         List<Dapan> k = tlDao.getListTraLoi(id);
         for(Dapan item: k){
            item.setDung(false);
         }
         return k;
    }

    @Override
    public List<Dapan> getListTraLoiWithKetQua(String id) {
        return tlDao.getListTraLoi(id);
    }
    @Override
    public void delete(Dapan id) {
        tlDao.delete(id);
    }
    
}
